package cn.vawn.exam.mapper;

import cn.vawn.exam.entity.Answer;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface AnswerMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Answer record);

    int insertSelective(Answer record);

    Answer selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Answer record);

    int updateByPrimaryKey(Answer record);

    /*
	 * 新建一条数据
	 */
    int insertAnswer(String content, String localunitermIds);

    /*
     * 根据问题id查询该问题的所有答案
     */
    List<Map<String, Object>> selectByAnswerId(String answerId);

    /*
     * 批量插入数据
     */
    int batchInsertAnswer(List<Answer> answers);

    /**
     * 批量删除
     */
    void batchDelete(List<Integer> answerIds);

    /*
     * 批量查询数据
     */
    List<Answer> batchSelectAnswers(List<Integer> answerIds);

    /*
     * 批量更新数据
     */
    void batchUpdateAnswers(List<Answer> answers);

    /*
     * 根据answerId查询绑定的本地单项id字符串
     */
    String getLocalUnitermIdsByAnswerId(int answerId);

    void updateSerial(@Param("answerId")Integer answerId, @Param("unUsedSerialNumids") String unUsedSerialNumids);
}